package com.hieu.android.designpattern.factory;

import android.app.Activity;
import android.widget.Button;
import android.widget.TextView;

import com.hieu.android.designpattern.demo.main.HieuDesignPattern;

public class ShapeFactory {
	private Activity activity = null;
	TextView tv1;
	Button btn1;

	private static final ShapeFactory shapeFactoryObject = new ShapeFactory();
	private void ShapeFactory() { }
	public static ShapeFactory getInstanceFactory() {
		return shapeFactoryObject;
	}
	
	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	public void onChangeShapeDrawing(int shapeType) {
		Shape shape = null;
		switch (shapeType) {
		case HieuDesignPattern.SHAPE_TYPE_CIRCLE:
			shape = new Circle();
			break;
		case HieuDesignPattern.SHAPE_TYPE_RECTANGLE:
			shape = new Rectangle();
			break;
		case HieuDesignPattern.SHAPE_TYPE_SQUARE:
			shape = new Square();
			break;

		default:
			break;
		}
		
		shape.onDrawShape(tv1);
	}

}
